package concurrency.chapter2;

public class TaxCalculator {
    private final double salary;
    private final double bonus;

    private final CalculatorStraregy calculatorStraregy;

    public double getSalary() {
        return salary;
    }

    public double getBonus() {
        return bonus;
    }

    public TaxCalculator(double salary, double bonus,CalculatorStraregy calculatorStraregy) {
        this.salary = salary;
        this.bonus = bonus;
        this.calculatorStraregy=calculatorStraregy;
    }
    protected double calcTax(){
        return calculatorStraregy.calculator(salary,bonus);
    }
    public double calculate(){
        return this.calcTax();
    }
}
